const { db, query } = require("../../db/db");
const util = require("util");
const moment = require("moment");

async function GetUserSignInDateList(req, res) {
  let UserId = Number(req.params.username);
  console.log("222", UserId);

  const Select_user = util.format(
    "Select IFNULL(SignInDate,'') as SignInDate,\
    IFNULL(CreateTime,'') as CreateTime,\
    UserId from User_Sign_In_Day Where UserId=%s",
    UserId
  );

  const Select_user_res = await query(Select_user);
  res.send({
    status: 0,
    DateList: Select_user_res,
  });
}

module.exports = { GetUserSignInDateList };
